package com.vne.skyemart.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.vne.skyemart.dao.ScreenDao;
import com.vne.skyemart.model.Screen;
import com.vne.skyemart.service.ScreenService;

@Service("screenService")
@Transactional(propagation = Propagation.SUPPORTS,readOnly = true)
public class ScreenServiceImpl implements ScreenService{
	@Autowired
	private ScreenDao screenDao;

	public ScreenDao getScreenDao() {
		return screenDao;
	}

	public void setScreenDao(ScreenDao screenDao) {
		this.screenDao = screenDao;
	}
	public ScreenServiceImpl() {}
	@Transactional(propagation = Propagation.SUPPORTS,readOnly = false)
	@Override
	public void addScreen(Screen screen) {
		screenDao.save(screen);		
	}

	@Override
	public List<Screen> listScreen() {
		return screenDao.findAll();
	}
	
}
